
<!DOCTYPE html>
<html lang="zh-CN" class="loading">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title> javascript 事件 - niko</title>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="google" content="notranslate" />
    <meta name="keywords" content="TriDiamond Obsidian,"> 
    <meta name="description" content="我想分享给你一些我的想法,
一、事件的种类
鼠标事件click  dbclick  mouseup  mousedown mousemove mouseover mouseenter  mouseout mouseleave,"> 
    <meta name="author" content="niko"> 
    <link rel="alternative" href="atom.xml" title="niko" type="application/atom+xml"> 
    <link rel="icon" href="/img/logo_icon.png"> 
    <link href="https://fonts.loli.net/css?family=Roboto+Mono|Rubik&display=swap" rel="stylesheet">
    
<link rel="stylesheet" href="//at.alicdn.com/t/font_1429596_nzgqgvnmkjb.css">

    
<link rel="stylesheet" href="//cdn.bootcss.com/animate.css/3.7.2/animate.min.css">

    
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/css/share.min.css">

    
<link rel="stylesheet" href="//cdn.bootcss.com/codemirror/5.48.4/codemirror.min.css">

    
<link rel="stylesheet" href="//cdn.bootcss.com/codemirror/5.48.4/theme/dracula.css">

    
<link rel="stylesheet" href="/css/obsidian.css">

    
<link rel="stylesheet" href="/css/ball-atom.min.css">

<meta name="generator" content="Hexo 4.2.0"></head>


<body class="loading">
    <div class="loader">
        <div class="la-ball-atom la-2x">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
    <span id="config-title" style="display:none">niko</span>
    <div id="loader"></div>
    <div id="single">
    <div class="scrollbar gradient-bg-rev"></div>
<div id="top" style="display: block;">
    <div class="bar" style="width: 0;"></div>
    <div class="navigation animated fadeIn fast delay-1s">
        <img id="home-icon" class="icon-home" src="/img/logo_icon.png" alt="" data-url="http://yoursite.com">
        <div id="play-icon" title="Play/Pause" class="iconfont icon-play"></div>
        <h3 class="subtitle"> javascript 事件</h3>
        <div class="social">
            <!--        <div class="like-icon">-->
            <!--            <a href="javascript:;" class="likeThis active"><span class="icon-like"></span><span class="count">76</span></a>-->
            <!--        </div>-->
            <div>
                <div class="share">
                    
                        <a href="javascript:;" class="iconfont icon-share1"></a>
                        <div class="share-component-cc" data-disabled="facebook,douban,linkedin,diandian,tencent,google"></div>
                    
                </div>
            </div>
        </div>
    </div>
</div>

    <div class="section">
        <div class=article-header-wrapper>
    <div class="article-header">
        <div class="article-cover animated fadeIn" style="
            animation-delay: 600ms;
            animation-duration: 1.2s;
            background-image: 
                radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
                url(/img/cover.jpg) ">
        </div>
        <div class="else">
            <p class="animated fadeInDown">
                
                <a href="/categories/Javascript"><b>「
                    </b>JAVASCRIPT<b> 」</b></a>
                
                八月 06, 2017
            </p>
            <h3 class="post-title animated fadeInDown"><a href="/2017/08/06/javascript-%E4%BA%8B%E4%BB%B6/" title=" javascript 事件" class=""> javascript 事件</a>
            </h3>
            
            <p class="post-count animated fadeInDown">
                
                <span>
                    <b class="iconfont icon-text2"></b> <i>文章字数</i>
                    7.2k
                </span>
                
                
                <span>
                    <b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
                    7 mins.
                </span>
                
                
                <span id="/2017/08/06/javascript-事件/" class="leancloud_visitors" data-flag-title=" javascript 事件">
                    <b class="iconfont icon-read"></b> <i>阅读次数</i>
                    <span class="leancloud-visitors-count">1000000</span>
                </span>
                
                
            </p>
            
            
            <ul class="animated fadeInDown post-tags-list" itemprop="keywords"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/js/" rel="tag">js</a></li></ul>
            
        </div>
    </div>
</div>

<div class="screen-gradient-after">
    <div class="screen-gradient-content">
        <div class="screen-gradient-content-inside">
            <div class="bold-underline-links screen-gradient-sponsor">
                <p>
                    <span class="animated fadeIn delay-1s"></span>
                </p>
            </div>
        </div>
    </div>
</div>

<div class="article">
    <div class='main'>
        <div class="content markdown animated fadeIn">
            <blockquote>
<h4 id="一、事件的种类"><a href="#一、事件的种类" class="headerlink" title="一、事件的种类"></a>一、事件的种类</h4></blockquote>
<h4 id="鼠标事件"><a href="#鼠标事件" class="headerlink" title="鼠标事件"></a>鼠标事件</h4><p><code>click</code>  <code>dbclick</code>  <code>mouseup</code>  <code>mousedown</code> <code>mousemove</code> <code>mouseover</code> <code>mouseenter</code>  <code>mouseout</code> <code>mouseleave</code></p>
<h4 id="滚轮事件"><a href="#滚轮事件" class="headerlink" title="滚轮事件"></a>滚轮事件</h4><p><code>wheel</code></p>
<h4 id="键盘事件"><a href="#键盘事件" class="headerlink" title="键盘事件"></a>键盘事件</h4><p><code>keydown</code>  <code>keypress</code>  <code>keyup</code></p>
<a id="more"></a>
<h4 id="进度事件"><a href="#进度事件" class="headerlink" title="进度事件"></a>进度事件</h4><p><code>abort</code> <code>error</code> <code>load</code> <code>loadstart</code>  <code>loadend</code>  <code>progress</code>  <code>timeout</code>   </p>
<h4 id="拖拽事件"><a href="#拖拽事件" class="headerlink" title="拖拽事件"></a>拖拽事件</h4><p><code>drag</code>  <code>dragstart</code>  <code>dragend</code>  <code>dragenter</code> <code>dragover</code> <code>dragleave</code>  <code>drop</code></p>
<h4 id="触摸事件"><a href="#触摸事件" class="headerlink" title="触摸事件"></a>触摸事件</h4><p><code>touchstart</code>  <code>touchend</code>  <code>toumove</code>  <code>touchcancel</code></p>
<h4 id="表单事件"><a href="#表单事件" class="headerlink" title="表单事件"></a>表单事件</h4><p><code>input</code>  <code>select</code>  <code>change</code>  <code>reset</code> <code>submit</code></p>
<h4 id="文档事件"><a href="#文档事件" class="headerlink" title="文档事件"></a>文档事件</h4><p><code>load</code> <code>error</code> <code>pageshow</code> <code>pagelive</code> <code>DOMContentLoaded</code> <code>readystatechange</code> <code>scroll</code> <code>resize</code> <code>copy</code> <code>cut</code> <code>paste</code> <code>focus</code> <code>focusin</code> <code>focusout</code>  <code>blur</code>  <code>hashchange</code> <code>popstate</code></p>
<blockquote>
<h4 id="二、事件传播的三个阶段"><a href="#二、事件传播的三个阶段" class="headerlink" title="二、事件传播的三个阶段"></a>二、事件传播的三个阶段</h4></blockquote>
<h5 id="1-捕获阶段"><a href="#1-捕获阶段" class="headerlink" title="1.捕获阶段"></a>1.捕获阶段</h5><p>从 <code>window</code> 对象传导到目标阶段的过程</p>
<h5 id="2-目标阶段"><a href="#2-目标阶段" class="headerlink" title="2.目标阶段"></a>2.目标阶段</h5><p>当事件在目标节点出发的过程</p>
<h5 id="3-冒泡阶段"><a href="#3-冒泡阶段" class="headerlink" title="3.冒泡阶段"></a>3.冒泡阶段</h5><p>从目标阶段传导回<code>window</code>对象的过程</p>
<h4 id="代码示意："><a href="#代码示意：" class="headerlink" title="代码示意："></a>代码示意：</h4><pre><code class="html">&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;
 &lt;meta charset=&quot;utf-8&quot;&gt;
 &lt;title&gt;&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;

 &lt;div&gt;
   &lt;p&gt;Click Me&lt;/p&gt;
 &lt;/div&gt;

&lt;/body&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
 var phases = {
   1: &#39;capture&#39;, //捕获阶段
   2: &#39;target&#39;, //当前
   3: &#39;bubble&#39; //冒泡
 };

 var div = document.querySelector(&#39;div&#39;);
 var p = document.querySelector(&#39;p&#39;);

 div.addEventListener(&#39;click&#39;, callback, true); // 捕获
 p.addEventListener(&#39;click&#39;, callback, true); //target
 div.addEventListener(&#39;click&#39;, callback, false); // 冒泡
 p.addEventListener(&#39;click&#39;, callback, false);  // target

 function callback(event) {
   console.log(event)
   var tag = event.currentTarget.tagName;

   var phase = phases[event.eventPhase];
   console.log(&quot;Tag: &#39;&quot; + tag + &quot;&#39;. EventPhase: &#39;&quot; + phase + &quot;&#39;&quot;);
 }
&lt;/script&gt;

&lt;/html&gt;</code></pre>
<h4 id="图示："><a href="#图示：" class="headerlink" title="图示："></a>图示：</h4><p><img src="https://app.yinxiang.com/shard/s72/res/8d53d1e2-c43a-408c-9e3f-a10bef9354ae" alt="Alt text"></p>
<h4 id="注意："><a href="#注意：" class="headerlink" title="注意："></a><span style="color:red">注意：</span></h4><h5 id="用户点击网页的时候，浏览器总是假定click事件的目标节点，就是点击位置的嵌套最深的那个节点（嵌套在-lt-div-gt-节点的-lt-p-gt-节点）。所以，-lt-p-gt-节点的捕获阶段和冒泡阶段，都会显示为target阶段。"><a href="#用户点击网页的时候，浏览器总是假定click事件的目标节点，就是点击位置的嵌套最深的那个节点（嵌套在-lt-div-gt-节点的-lt-p-gt-节点）。所以，-lt-p-gt-节点的捕获阶段和冒泡阶段，都会显示为target阶段。" class="headerlink" title="用户点击网页的时候，浏览器总是假定click事件的目标节点，就是点击位置的嵌套最深的那个节点（嵌套在&lt;div&gt;节点的&lt;p&gt;节点）。所以，&lt;p&gt;节点的捕获阶段和冒泡阶段，都会显示为target阶段。"></a>用户点击网页的时候，浏览器总是假定click事件的目标节点，就是点击位置的嵌套最深的那个节点（嵌套在<code>&lt;div&gt;</code>节点的<code>&lt;p&gt;</code>节点）。所以，<code>&lt;p&gt;</code>节点的捕获阶段和冒泡阶段，都会显示为target阶段。</h5><blockquote>
<h4 id="三、事件代理"><a href="#三、事件代理" class="headerlink" title="三、事件代理"></a>三、事件代理</h4></blockquote>
<h5 id="由于事件会在冒泡阶段向上传播到父节点，因此可以把子节点的监听函数定义在父节点上，由父节点的监听函数统一处理多个子元素的事件。这种方法叫做事件的代理（delegation）。"><a href="#由于事件会在冒泡阶段向上传播到父节点，因此可以把子节点的监听函数定义在父节点上，由父节点的监听函数统一处理多个子元素的事件。这种方法叫做事件的代理（delegation）。" class="headerlink" title="由于事件会在冒泡阶段向上传播到父节点，因此可以把子节点的监听函数定义在父节点上，由父节点的监听函数统一处理多个子元素的事件。这种方法叫做事件的代理（delegation）。"></a>由于事件会在冒泡阶段向上传播到父节点，因此可以把子节点的监听函数定义在父节点上，由父节点的监听函数统一处理多个子元素的事件。这种方法叫做事件的代理（delegation）。</h5><pre><code class="html"> &lt;ul&gt;
   &lt;li&gt;&lt;/li&gt;
   &lt;li id=&quot;lis&quot;&gt;
     &lt;p onclick=&quot;pClick()&quot;&gt;click me&lt;/p&gt;
   &lt;/li&gt;
   &lt;li&gt;&lt;/li&gt;
   &lt;li&gt;&lt;/li&gt;
 &lt;/ul&gt;</code></pre>
<pre><code class="javascript"> var ul = document.querySelector(&#39;ul&#39;);
 var lis = document.querySelector(&#39;#lis&#39;);

 // lis 的监听函数

 lis.addEventListener(&#39;click&#39;, (event) =&gt; {
   console.log(&#39;这个是li的第一个监听函数&#39;)
   event.stopPropagation()  // 阻止当前事件向上冒泡  ，故 ul监听事件不执行
   event.stopImmediatePropagation()  //  event.stopPropagation只能阻止当前监听事件不冒，但是阻止不了其他监听事件 ，所以使用    event.stopImmediatePropagation

 })
 lis.addEventListener(&#39;click&#39;, (event) =&gt; {
   console.log(&#39;这个是li的第二个监听函数&#39;)
 })
 // p 元素的监听函数
 function pClick() {

   console.log(&#39;这个是P元素的监听函数&#39;)
 }
 //   ul监听函数
 ul.addEventListener(&#39;click&#39;, (event) =&gt; {
   console.log(&#39;ul的第一个监听函数&#39;)
   // 事件代理 处理 子元素 p 的点击
   // if (event.target.tagName.toLowerCase() == &quot;p&quot;) {
   //   // p节点触发
   //   console.log(&#39;点击了P元素&#39;)
   //
   // }

 })


 ul.addEventListener(&#39;click&#39;, (event) =&gt; {
   console.log(&#39;ul的第二个监听函数&#39;)
 })
</code></pre>
<h4 id="stopPropagation-和-stopImmediatePropagation-区别-："><a href="#stopPropagation-和-stopImmediatePropagation-区别-：" class="headerlink" title="stopPropagation  和  stopImmediatePropagation 区别 ："></a><code>stopPropagation</code>  和  <code>stopImmediatePropagation</code> 区别 ：</h4><p>　　在事件处理程序中，每个事件处理程序中间都会有一个event对象，而这个event对象有两个方法，一个是stopPropagation方法，一个是stopImmediatePropagation方法，两个方法只差一个Immediate，这里就说说这两个方法的区别</p>
<p>　　1、<code>stopImmediatePropagation</code>方法：</p>
<p>　　　　stopImmediatePropagation方法作用在当前节点以及事件链上的所有后续节点上，目的是在执行完当前事件处理程序之后，停止当前节点以及所有后续节点的事件处理程序的运行</p>
<p>　　2、<code>stopPropagation</code>方法</p>
<p>　　　　stopPropagation方法作用在后续节点上，目的在执行完绑定到当前元素上的所有事件处理程序之后，停止执行所有后续节点的事件处理程序</p>
<hr>

<p>　从概念上讲，在调用完stopPropagation函数之后，就会立即停止对后续节点的访问，但是会执行完绑定到当前节点上的所有事件处理程序；而调用stopImmediatePropagation函数之后，除了所有后续节点，绑定到当前元素上的、当前事件处理程序之后的事件处理程序就不会再执行了</p>
<hr>
#### 版权说明：
阮一峰大神 [javascript标准参考教程](http://javascript.ruanyifeng.com/dom/event.html#toc8)
超载的笨鸟 [浅谈javascript中stopImmediatePropagation函数和stopPropagation函数的区别](http://www.cnblogs.com/dqsBK/p/6287907.html)

            <!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->
            <audio id="audio" loop="1" preload="auto" controls="controls"
                data-autoplay="false">
                <source type="audio/mpeg" src="">
            </audio>
            
            <ul id="audio-list" style="display:none">
                
                
                <li title='0' data-url='/statics/chengdu.mp3'></li>
                
                    
            </ul>
            
            
            
    <div id='gitalk-container' class="comment link"
        data-ae='true'
        data-ci='ec894e2b66f752e8b7fb'
        data-cs='3ccc2e92bb350688fe2c2dc2930189b62622bfb1'
        data-r='blog-comments'
        data-o='TriDiamond'
        data-a='TriDiamond'
        data-d=''
    >留言</div>


            
            
            <div id="vcomments"></div>
            
        </div>
        <div class="sidebar">
            <div class="box animated fadeInRight">
                <div class="subbox">
                    <img src="https://res.cloudinary.com/tridiamond/image/upload/v1573019751/TriDiamond_logo_ui_xeublz.jpg" height=300 width=300></img>
                    <p>niko</p>
                    <span>Think like an artist, develop like an artisan</span>
                    <dl>
                        <dd><a href="https://github.com/TriDiamond" target="_blank"><span
                                    class=" iconfont icon-github"></span></a></dd>
                        <dd><a href="https://twitter.com/TriDiamond6" target="_blank"><span
                                    class=" iconfont icon-twitter"></span></a></dd>
                        <dd><a href="https://stackoverflow.com/users/7602324/tridiamond?tab=profile" target="_blank"><span
                                    class=" iconfont icon-stack-overflow"></span></a></dd>
                    </dl>
                </div>
                <ul>
                    <li><a href="/">20 <p>文章</p></a></li>
                    <li><a href="/categories">10 <p>分类</p></a></li>
                    <li><a href="/tags">11 <p>标签</p></a></li>
                </ul>
            </div>
            
            
            
            
        </div>
    </div>
</div>

    </div>
</div>
    <div id="back-to-top" class="animated fadeIn faster">
        <div class="flow"></div>
        <span class="percentage animated fadeIn faster">0%</span>
        <span class="iconfont icon-top02 animated fadeIn faster"></span>
    </div>
</body>
<footer>
    <p class="copyright" id="copyright">
        &copy; 2020
        <span class="gradient-text">
            niko
        </span>.
        Powered by <a href="http://hexo.io/" title="Hexo" target="_blank" rel="noopener">Hexo</a>
        Theme
        <span class="gradient-text">
            <a href="https://github.com/TriDiamond/hexo-theme-obsidian" title="Obsidian" target="_blank" rel="noopener">Obsidian</a>
        </span>
        <small><a href="https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/CHANGELOG.md" title="v1.4.3" target="_blank" rel="noopener">v1.4.3</a></small>
    </p>
</footer>

<script type="text/javascript" src="https://cdn.bootcss.com/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script>
  MathJax.Hub.Config({
    "HTML-CSS": {
      preferredFont: "TeX",
      availableFonts: ["STIX", "TeX"],
      linebreaks: {
        automatic: true
      },
      EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50)
    },
    tex2jax: {
      inlineMath: [
        ["$", "$"],
        ["\\(", "\\)"]
      ],
      processEscapes: true,
      ignoreClass: "tex2jax_ignore|dno",
      skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    },
    TeX: {
      noUndefined: {
        attributes: {
          mathcolor: "red",
          mathbackground: "#FFEEEE",
          mathsize: "90%"
        }
      },
      Macros: {
        href: "{}"
      }
    },
    messageStyle: "none"
  });
</script>
<script>
  function initialMathJax() {
    MathJax.Hub.Queue(function () {
      var all = MathJax.Hub.getAllJax(),
        i;
      // console.log(all);
      for (i = 0; i < all.length; i += 1) {
        console.log(all[i].SourceElement().parentNode)
        all[i].SourceElement().parentNode.className += ' has-jax';
      }
    });
  }

  function reprocessMathJax() {
    if (typeof MathJax !== 'undefined') {
      MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
    }
  }
</script>



    
<link rel="stylesheet" href="//cdn.bootcss.com/gitalk/1.5.0/gitalk.min.css">

    
<script src="//cdn.bootcss.com/gitalk/1.5.0/gitalk.min.js"></script>



<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="/js/plugin.js"></script>
<script src="/js/obsidian.js"></script>
<script src="/js/jquery.truncate.js"></script>
<script src="/js/search.js"></script>


<script src="//cdn.bootcss.com/typed.js/2.0.10/typed.min.js"></script>


<script src="//cdn.bootcss.com/blueimp-md5/2.12.0/js/md5.min.js"></script>


<script src="//cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/js/social-share.min.js"></script>


<script src="https://cdn.bootcss.com/codemirror/5.48.4/codemirror.min.js"></script>

    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/javascript/javascript.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/css/css.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/xml/xml.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/htmlmixed/htmlmixed.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/clike/clike.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/php/php.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/shell/shell.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/python/python.min.js"></script>




    
<script src="/js/busuanzi.min.js"></script>

    <script>
        $(document).ready(function () {
            if ($('span[id^="busuanzi_"]').length) {
                initialBusuanzi();
            }
        });
    </script>



<link rel="stylesheet" href="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="//cdn.bootcss.com/photoswipe/4.1.3/default-skin/default-skin.min.css">


<script src="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>
    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">
        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>
        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">
            <div class="pswp__top-bar">
                <!--  Controls are self-explanatory. Order can be changed. -->
                <div class="pswp__counter"></div>
                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
                <button class="pswp__button pswp__button--share" title="Share"></button>
                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>
            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>
            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>
            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>
        </div>
    </div>
</div>



    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="//www.googletagmanager.com/gtag/js?id=UA-149874671-1"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());

        gtag('config', 'UA-149874671-1');
    </script>





<script>
    function initialTyped () {
        var typedTextEl = $('.typed-text');
        if (typedTextEl && typedTextEl.length > 0) {
            var typed = new Typed('.typed-text', {
                strings: ["Think like an artist, develop like an artisan", "艺术家思维去思考问题，工匠创造精神去开发"],
                typeSpeed: 90,
                loop: true,
                loopCount: Infinity,
                backSpeed: 20,
            });
        }
    }

    if ($('.article-header') && $('.article-header').length) {
        $(document).ready(function () {
            initialTyped();
        });
    }
</script>


    
<script src="//unpkg.com/valine/dist/Valine.min.js"></script>

    <script>

        var valine = new Valine();

        function initValine(path) {
            if (!path) path = window.location.pathname;
            let language = 'zh-CN';
            if (!language) {
                language = 'en';
            } else {
                language = language.toLowerCase();
            }
            valine.init({
                el: '#vcomments',
                appId: 'h0Nbcp32WtIpnnHaGTLWbtKo-gzGzoHsz',
                appKey: 'hPhFiAi2vIj2OStCIi79waty',
                notify: 'false',
                verify: 'false',
                avatar: 'happ_niko',
                placeholder: '快写下你的想法与我互动',
                visitor: 'true',
                path: path,
                lang: language
            });
        }

        $(document).ready(function () {
            initValine();
        });
    </script>



</html>
